package org.imac.quizz;

import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.widget.Toast;

public class PreferenceQuizz extends PreferenceActivity implements OnSharedPreferenceChangeListener, OnPreferenceClickListener {
	SharedPreferences preference;
	 @Override
	 public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        
	        addPreferencesFromResource(R.xml.preferences);

	        preference = getPreferenceManager().getSharedPreferences();
	 }
	public void onSharedPreferenceChanged(SharedPreferences sharedPreference, String key) {
		Toast.makeText(this, key+ sharedPreference.getString(key, ""), Toast.LENGTH_SHORT).show();
	}
	public boolean onPreferenceClick(Preference pref) {
		Toast.makeText(this, pref.getKey() + pref.getTitle(), Toast.LENGTH_LONG).show();
		return true;
	}
}
